package com.zzyl.member.utils;

import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Component
@Slf4j
public class RegisterInterceptor implements WebMvcConfigurer {
    @Autowired
    private smallProgramInterceptor smallProgramInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        log.warn("注册拦截器");
        registry.addInterceptor(smallProgramInterceptor)
                .addPathPatterns("/member/**")
                .excludePathPatterns("/member/user/login").excludePathPatterns("/member/roomTypes");
    }
}
